<script language="javascript" >
function delop(ucl){ 
newopen=window.open(ucl,'栏目选择窗口','height=60,width=180,top=200,left=350,toolbar=no,menubar=no,scrollbars=no,resizable=no,location=center,status=no'); 
}
</script>
<?php
require_once("../include/conn.php");
$table=$tb_dz;
$id=0;
$lanmu=$title=$action=$nname='';
if (isset($_GET['name'])) {
	$nname=$_REQUEST['name'];
}
if (isset($_GET['id'])) {
	$id=$_REQUEST['id'];
}
if (isset($_GET['action'])) {
	$action=$_REQUEST['action'];
}
if ($action=='add') {//添加记录
	if ($nname=='3') {//
		$lanmu='<select name="lanmu" id="lanmu">';
			$sql_parent="select * from $tb_bm where id<8 and  parentid='0'";
			$parent_conn=mysql_query($sql_parent); 
			while($parent_row=mysql_fetch_array($parent_conn)){
				$lanmu.="<option value=".$parent_row[id]." >".$parent_row[buname]."</option>\n";			 
			  }		  
	      $lanmu.='</select>注意：信息只能发布在最下级栏目内';
		$title='综合信息管理';
	}elseif ($nname=='4'){//
		$lanmu='<input name="lanmu" id="lanmu" onclick="delop(\'';
		$lanmu.='erlan.php?name='.$nname.'\')"  value="" readonly="readonly" /><span class="redtxt">*</span>此处为弹出菜单的返回值。';      
		$title='学习天地管理';
	}elseif ($nname=='9'){//
		$lanmu='<input name="lanmu" id="lanmu" onclick="delop(\'';
		$lanmu.='erlan.php?name='.$nname.'\')"  value="" readonly="readonly" /><span class="redtxt">*</span>此处为弹出菜单的返回值。';   
		$title='任务图表管理';
	}else {//
		self("参数不全!","admin_index.php");
	}
}else if ($action=='update' && $id<>'0') {//修改记录
	$sql_up="select * from $table   where id = $id ";
	$cn_up=mysql_db_query($db_name,$sql_up);
	$row_up = mysql_fetch_array($cn_up);
	if ($nname=='3') {//
		$lanmu='<select name="lanmu" id="lanmu">';
			$sql_parent="select * from $tb_bm where id<8 and  parentid='0'";
			$parent_conn=mysql_query($sql_parent); 
			while($parent_row=mysql_fetch_array($parent_conn)){
				$lanmu.= "<option value='".$parent_row[id];				
				$lanmu.= " '";
						if($row_up[11]==$parent_row[id]) {
							$lanmu.= "  selected  ";
						}
				$lanmu.= ">".$parent_row[buname]."</option>\n";			 
			  }		  
	    $lanmu.='</select>注意：信息只能发布在最下级栏目内';
		$title='综合信息管理';
	}elseif ($nname=='4'){//
		$lanmu='<input name="lanmu" id="lanmu" onclick="delop(\'';
		$lanmu.='erlan.php?name='.$nname.'\')"  value="'.$row_up[buid].'" readonly="readonly" /><span class="redtxt">*</span>此处为弹出菜单的返回值。';      
		$title='学习天地管理';
	}elseif ($nname=='9'){//
		$lanmu='<input name="lanmu" id="lanmu" onclick="delop(\'';
		$lanmu.='erlan.php?name='.$nname.'\')"  value="'.$row_up[buid].'" readonly="readonly" /><span class="redtxt">*</span>此处为弹出菜单的返回值。';   
		$title='任务图表管理';
	}else {//
		self("参数不全!","admin_index.php");
	}	
}else {
	self("参数不全!","admin_index.php");
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<script language="javascript" src="checkinfo.js"></script>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title><?php echo $title ?></title>
<link href="Admin_Style.css" rel="stylesheet" type="text/css">
</head>
<body>
<form action="update_ok.php" method="post"  name="myform" onSubmit="return Checked();">
  <table width="100%"  border="0" cellpadding="0" cellspacing="4" class="tdbg">
    <tr>
      <th colspan="2" class="topbg"><?php echo $title ?></th>
    </tr><input type=hidden name="name" value="<?php echo $nname; ?>">
		<input type=hidden name="id" value="<?php echo $id; ?>">
    <tr>
      <td width="164" align="right">标题：</td>
      <td width="770"><input name="title" type="text" value="<?php echo $row_up[title]; ?>" id="title" size="60">
        <span class="redtxt">*</span></td>
    </tr>	
    <tr>
      <td align="right">发布栏目：</td>
      <td>     
      <?php echo $lanmu ?>
      </td>
    </tr>	
	<tr>
		  <td align="right">发布单位：</td>
		  <td><input name="author" type="text" id="author" value="<?php echo $row_up[author] ?>" size="40" ><span class="redtxt">*</span>	  </td>
		</tr><tr>
		  <td align="right">日期：</td>
		  <td><script src="../js/datetime.js" type="text/javascript" language="javascript"></script>		  
			<input name="tdate" type="text" id="tdate"  onclick="setDayHM(this);"  readonly="readonly"  value="<?php echo $row_up[tdate]; ?>"><span class="redtxt">*</span>	  </td>
		</tr>
		<tr height='60'>
		  <td align="right">站情快报：</td>
		  <td><input name="iszqkb" type="checkbox" id="iszqkb" value="1" <?php if($row_up[iszqkb]==1) echo "checked";?>>
			如果是站情快报,请选择.</td>
		</tr>
		 <tr height='60'>
		  <td align="right">重要文电：</td>
		  <td><input name="ishit" type="checkbox" id="ishit" value="1" <?php if($row_up[ishit]==1) echo "checked";?>>
			如果是重要文电,请选择.</td>
		</tr>
		<tr height='60'>
		  <td align="right">动态信息是否：</td>
		  <td><input name="jian" type="checkbox" id="jian" value="1" <?php if($row_up[jian]==1) echo "checked";?>>
			如果是动态信息,请选择.</td>
		</tr>
		<tr><input type=hidden name=pic id=myText3 >
		  <td align="right">内容：</td>
      <td><input name="content1" type="hidden" value="<?php echo htmlspecialchars($row_up[content]); ?>">
      <!--直接使用 -->
      <iframe id="eWebEditor1" src="../ewebeditor/ewebeditor.htm?id=content1&style=standard650&skin=office2003&savepathfilename=myText3" frameborder="0" scrolling="no" width="650" height="450"></iframe>
      	  <span class="redtxt">*</span></td>
    </tr>
    <tr>
      <td align="right">&nbsp;</td>
      <td><input type="submit" name="Submit" value="提交">
	   <input type="hidden" name="action" value="check">
        <input name="action" type="hidden" id="action" value="<?php echo $action?>">
      <input type="reset" name="Submit" value="重置"></td>
    </tr>
  </table>
</form>
</body>
</html>

